package br.com.moxeon.model.cash;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import br.com.moxeon.model.MoxeonControlledPersistentEntity;
import br.com.moxeon.model.enums.CashSituation;

@SuppressWarnings("serial")
@Entity
@Table(name="opening_cash")
@Deprecated
public class OpeningCash extends MoxeonControlledPersistentEntity{
	//TODO ///private Usuario usuario;
	@Column(nullable=false,name="opening_date")
	private Date OpeningDate;
	@Column(name="closing_date")
	private Date ClosingDate;
	@Enumerated
	private CashSituation situation;
	@ManyToOne(targetEntity=Cash.class, fetch=FetchType.LAZY,optional=false) 
	@JoinColumn(name="cash_id",nullable=false)
	private Cash cash;
	@Column(name="open_for_all")
	private boolean openForEverbody;
	@Column(name="value_closing")
	private Double valueAtClosing;
	/*
	@Deprecated
	@OneToMany(targetEntity=Throw.class, mappedBy="openingCash", fetch=FetchType.LAZY)
	private List<Throw> listThrows;
	*/
	public Date getOpeningDate() {
		return OpeningDate;
	}
	public Date getClosingDate() {
		return ClosingDate;
	}
	public CashSituation getSituation() {
		return situation;
	}
	public Cash getCash() {
		return cash;
	}
	public boolean isOpenForEverbody() {
		return openForEverbody;
	}
	public Double getValueAtClosing() {
		return valueAtClosing;
	}
	/*
	@Deprecated
	public List<Throw> getListThrows() {
		return listThrows;
	}
	public void setListThrows(List<Throw> listThrows) {
		this.listThrows = listThrows;
	}
	*/
	public void setOpeningDate(Date openingDate) {
		OpeningDate = openingDate;
	}
	public void setClosingDate(Date closingDate) {
		ClosingDate = closingDate;
	}
	public void setSituation(CashSituation situation) {
		this.situation = situation;
	}
	public void setCash(Cash cash) {
		this.cash = cash;
	}
	public void setOpenForEverbody(boolean openForEverbody) {
		this.openForEverbody = openForEverbody;
	}
	public void setValueAtClosing(Double valueAtClosing) {
		this.valueAtClosing = valueAtClosing;
	}
	
	
	
	
	
}